package ru.autofan.view;

import java.io.Serializable;

import ru.autofan.domain.FotoType;

public class CarFotoBean implements Serializable {

	private static final long serialVersionUID = 1L;

	private FotoType fotoType;

	private byte[] data;

	public byte[] getData() {
		return data;
	}

	public void setData(byte[] data) {
		this.data = data;
	}

	public String getContentType() {
		String contentType = "image/";
		switch (fotoType) {
		case GIF:
			contentType += "gif";
			break;
		case PNG:
			contentType += "png";
			break;
		case JPG:
			contentType += "jpeg";
			break;
		default:
			contentType += "jpeg";
			break;
		}
		return contentType;
	}

	public void setFotoType(FotoType fotoType) {
		this.fotoType = fotoType;
	}

}
